package com.ck.system.mapper;

import com.ck.common.entity.SysDept;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author changk
 * @date 2024/11/13 15:00
 */
@Mapper
public interface SysDeptMapper {
    List<SysDept> selectDeptList(SysDept dept);

    List<Long> selectDeptListByRoleId(@Param("roleId") Long roleId, @Param("deptCheckStrictly") boolean deptCheckStrictly);

    SysDept checkDeptNameUnique(@Param("deptName") String deptName, @Param("parentId") Long parentId);

    SysDept selectDeptById(Long parentId);

    int insertDept(SysDept dept);

    int selectNormalChildrenDeptById(Long deptId);

    List<SysDept> selectChildrenDeptById(Long deptId);

    int updateDeptChildren(@Param("depts")List<SysDept> children);

    int updateDept(SysDept dept);

    void updateDeptStatusNormal(Long[] deptIds);
}
